EMT Practice Test

1. Question Content...


Question List

Question1: Universal Containers is using a custom Salesforce application to manage customer support cases. The support team needs to collaborate with external partners to resolve certain cases. However, they want to control the visibility and access to the cases shared with the external partners. Which Salesforce feature can help achieve this requirement?

Question2: Universal Containers is leading a development team that follows the source-driven development approach in Salesforce. As part of their continuous integration and delivery (CL/CD) process, they need to automatically deploy changes to multiple environments, including sandbox and production.
'Which mechanism or tool would best support their CI/CD pipeline in source-driven development?

Question3: Refer to the following code snippet:

A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling geyFetchLeadList whencertain criteria are met.
Which three changes should the developer implement in the Apex class above to ensure the LWC can display data efficiently while preserving security?
Choose 3 answers

Question4: A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a custom object called survey Response c do not belong to a list of blocked domains.
The list of blocked domains is stored in a custom object for ease of maintenance by users. The survey Response c object is populated via a custom Visualforce page.
What is the optimal way to implement this?

Question5: Universal Containers uses Big Objects to store almost a billion customer transactions called Customer_Transaction__b.
These are the fields on Customer_Transaction__b:
Account__c -
Program__c -
Points_Earned__c -
Location__c -
Transaction_Date__c -
The following fields have been identified as Index Fields for the Customer_Transaction__b object:
Account__c, Program__c, and Transaction_Date__c.
Which SOQL query is valid on the Customer_Transaction__b Big Object?

Question6: A developer is building a Lightning web component that retrieves data from Salesforce and assigns it to the record property.

What must be done in the component to get the data from Salesforce?

Question7: A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow.
What can a developer to do address the issue?

Question8: A company has a custom component that allows users to search for records of a certain object type by invoking an Apex Controller that returns a list of results based on the user's input. When the search is completed, a searchComplete event is fired, with the results put in a results attribute of the event. The component is designed to be used within other components and may appear on a single page more than once.
What is the optimal code that should be added to fire the event when the search has completed?

Question9: Consider the below trigger intended to assign the Account to the manager of the Account's region:

Which two changes should a developer make in this trigger to adhere to best practices?
Choose 2 answers

Question10: A page throws an 'Attempt to dereference a null object' error for a Contact.
What change in the controller will fix the error?

Question11: Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity's Account?

Question12: An Apex class does not achieve expected code coverage. The testsetup method explicitly calls a method In the Apex class..
How can the developer generate the code coverage?

Question13: A company has reference data stored in multiple custom metadata records that represent default information and delete behavior for certain geographic regions.
When a contact is inserted, the default information should be set on the contact from the custom metadata records based on the contact's address information.
Additionally, if a user attempts to delete a contact that belongs to a flagged region, the user must get an error message.
Depending on company personnel resources, what are two ways to automate this?
Choose 2 answers

Question14: A developer created a Lightning web component that uses a lightning-record-edit-form to collect information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record.
What is the recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention?

Question15: A developer writes a Lightning web component that displays a dropdown list of all custom objects in the org from which a user will select. An Apex method prepares and returns data to the component.
What should the developer do to determine which objects to include in the response?

Question16: A company has a custom object, Order__c, that has a custom picklist field, Status__c, with values of `"New',
`"In Progress', or `"Fulfilled' and a lookup field,
Contact__c, to Contact.
Which SOQL query will return a unique list of all the Contact records that have no `"Fulfilled' Orders?

Question17: A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and 5P3 {created in order), before the final execution of the process.
During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls 2 roll back to SP3 to continue with final execution. However, when the roll back to SP3 is called, a Funtime error occurs.
Why does the developer receive a runtime error?

Question18: The use of the transient keyword in Visualforce page controllers helps with which common performance issue?

Question19: Exhibit.

Given the code above, which two changes need to be made in the Apex Controller for the code to work?
Choose 2 answers

Question20: An Apex trigger and Apex class increment a counter, Edit __C, any time the Case is changed.

Question21: How can a developer efficiently incorporate multiple JavaScript libraries in an Aura component?

Question22: A developer created 2 class that implements the Queueable Interface, as follows:

As part of the deployment process, the developer is asked to create a corresponding test class.
Which two actions should the developer take to successfully execute the test class?
Choose 2 answers

Question23: A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes.
Which tool or mechanism should be utilized for managing the source-driven deployment process?

Question24: Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required?

Question25: Universal Containers uses a custom Lightning page to provide a mechanism to perform a step-by-step wizard search for Accounts. One of the steps in the wizard is to allow the user to input text into a text field, ERF Number_c, that is then used in a query to find matching Accounts.

Which step should be taken to resolve the issue?

Question26: Consider the Apex class below that defines a RemoteAction used on 2 Visualforce search page.

Which code snippet will assert that the remote action returned the correct Account?

Question27: A developer needs to implement a system audit feature that allows users, assigned to a custom profile named
"Auditors", to perform searches against the historical records in the Account object. The developer must ensure the search is able to return history records that are between 6 and 12 months old.
Given the code below, which select statement should be inserted below as a valid way to retrieve the Account History records ranging from 6 to 12 months old?

Question28: A developer wrote an Apex class to make several callouts to an external system.
If the URLs used in these callouts will change often, which feature should the developer use to minimize changes needed to the Apex class?

Question29: Universal Containers wants to use a Customer Community with Customer Community Plus licenses to allow their customers access to track how many containers they have rented and when they are due back. Universal Containers uses a Private sharing model for External users, Many of their customers are multi-national corporations with complex Account hierarchies. Each account on the hierarchy represents a department within the same business, One of the requirements is to allow certain community users within the same Account hierarchy to see several departments' containers, based on a custom junction object that relates the Contact to the various Account records that represent the departments.
Which solution solves these requirements?

Question30: A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of all the test data that is needed to perform the tests. What should the developer do to speed up test execution?

Question31: A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunity's Account whenever an Opportunity is closed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails.
What might be causing the failed assertion?

Question32: A Salesforce org has more than 50,000 contacts. A new business process requires a calculation that aggregates data from all of these contact records. This calculation needs to run once a day after business hours.
which two steps should a developer take to accomplish this?
Choose 2 answers

Question33: A developer needs to store variables to control the style and behavior of a Lightning Web Component.
Which feature can be used to ensure that the variables are testable in both Production and all Sandboxes?

Question34: A company has a Lightning page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data.
What can a developer use to analyze and diagnose the problem in the Lightning page?

Question35: A developer is inserting, updating, and deleting multiple lists of records in a single transaction and wants to ensure that any error prevents all execution.
How should the developer implement error exception handling in their code to handle this?

Question36: When the code is executed, the callout is unsuccessful and the following error appears within the Developer Console:
System.CalloutException: Unauthorized endpoint
Which recommended approach should the developer implement
to resolve the callout exception?

Question37: A developer created a JavaScript library that simplifies the development of repetitive tasks and features and uploaded the library as a static resource called rsutils in Salesforce. Another developer is coding a new Lightning web component (LWC) and wants to leverage the library, Which statement properly loads the static resource within the LWC?

Question38: A developer created a Lightning web component for the Account record page that displays the five most recently contacted Contacts for an Account. The Apex method, Contacts, returns a list of Contacts and will be wired to a property in the component.

Which two lines must change in the above code to make the Apex method able to be wired?
Choose 2 answers

Question39: A developer is writing a Visualforce page that queries accounts in the system and presents a data table with the results. The users want to be able to filter the results based on up to five fields. However, the users want to pick the five fields to use as filter fields when they run the page.
Which Apex code feature is required to facilitate this solution?

Question40: Salesforce users consistently receive a "Maximum trigger depth exceeded" error when saving an Account.
How can a developer fix this error?

Question41: Universal Containers develops a Salesforce application that requires frequent interaction with an external REST API.
To avoid duplicating code and improve maintainability, how should they implement the APL integration for code reuse?

Question42: Refer to the following code snippets:
A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by the currently logged-in user.

When the component is rendered, the following message is displayed: "Error retrieving data".
Which modification should be implemented to the Apex class to overcome the issue?

Question43: A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:

How can the component"5 controller get the context of the Lightning page that the sObject is on without requiring additional test coverage?

Question44: A developer wrote a class named asccuntRisteryManager that relies on field history tracking. The class has a static method called getaccountHistory that Lakes in an Account as a parameter and returns a list of associated accountHistory object records.
The following test fails:

What should be done to make this test pass?

Question45: When the sales team views an individual customer record, they need to see recent interactions for the customer. These interactions can be sales orders, phone calls, or Cases. The date range for recent interactions will be different for every customer record type.
How can this be accomplished?

Question46: Universal Containers analyzes a Lightning web component and its Apex controller class that retrieves a list of contacts associated with an account. The code snippets are as follows:

Based on the code snippets, what change should be made to display the contacts' mailing addresses in the Lightning web component?

Question47: A developer needs to implement a historical Task reporting feature that allows users, assigned to a custom profile named "Auditors", to perform searches against the Tasks related to the Account object.
The developer must ensure the search is able to return Tasks that are between 12 and 24 months old. It should exclude any tasks which have been deleted, and include Tasks whether archived or not.
Given the following code, which select statement should be inserted at the placeholder as a valid way to retrieve the Tasks ranging from L2 to 24 months old?

Question48: Which statement is considered a best practice for writing bulk safe Apex triggers?

Question49: A developer has a test class that creates test data before making a mock callout but now receives a 'You have uncommitted work pending. Please commit or rollback before calling out' error.
Which step should be taken to resolve the error?

Question50: A developer created a Lightning web component mat allows users to Input a text value that is used to search for Accounts by calling an Apex method. The Apex method returns a list of account to apply and is called imperatively from a JavaScript event handler.

Which two changes should the developer make so the Apex method functions correctly.
Choose 2 answers

Question51: A developer is writing a Jest test for a Lightning web component that conditionally displays child components based on a user's checkbox selections.
What should the developer do to properly test that the correct components display and hide for each scenario?

Question52: A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter view state errors when using it in production.
What should the developer ensure to correct these errors?

Question53: A developer created a Lightning web component that uses a Lightning_record_edit_fom to collect Information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record.
Which best practice should the developer use to perform the validations on more than one held, thus allowing more than one error message to be displayed simultaneously?

Question54: A developer is asked to modify a Lightning web component so that it displays in one column on phones and in two columns on tablets, desktops, and larger devices.
Given to the code below:

Which should the developer add to the code to meet the requirements?

Question55: Which three Visualforce components can be used to initiate Ajax behavior to perform partial page updates?
Choose 3 answers

Question56: Refer to the test method below:

The test method calls an @future method that increments the
Number_of_Times_Viewed__c value. The assertion is failing because the
Number of Times Viewed_c equals 0.
What is the optimal way to fix this?

Question57: A company has an Apex process that makes multiple extensive database operations and web service callouts.
The database processes and web services can take a long time to run and must be run sequentially.
How should the developer write this Apex code without running into governor limits and system limitations?

Question58: Consider the controller code below that is called from an Aura component and returns data wrapped in a class.

The developer verified that the queries return a single record each and there is error handling in the Aura component, but the component is not getting anything back when calling the controller getSemeData.
'What is wrong?

Question59: Given the following code:

Assuming there were 10 Contacts and five Accounts created today, what is the expected result?

Question60: What is a benefit of JavaScript remoting over Visualforce Remote Objects?

Question61: A developer has a Visualforce page that automatically assigns ewnership of an Account to a queue upon save.
The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
What can cause this problem?

Question62: A user receives the generic "An internal server error has occurred" while interacting with a custom Lightning component.
What should the developer do to ensure a more meaningful message?

Question63: Universal Containers needs to integrate with their own, existing, internal custom web application. The web application accepts JSON payloads, resizes product images, and sends the resized images back to Salesforce.
What should the developer use to implement this integration?

Question64: Consider the following code snippet:

As part of the deployment cycle, a developer creates the following test class:

When the test class runs, the assertion fails.
Which change should the developer implement in the Apex test method to ensure the test method executes successfully?

Question65: Which method should be used to convert a Date to a String in the current user's locale?

Question66: Refer to the Lightning component below:

The Lightning Component allows users to click a button to save their changes and then redirects them to a different page.
Currently when the user hits the Save button, the records are getting saved, but they are not redirected.
Which three techniques can a developer use to debug the JavaScript?
Choose 3 answers

Question67: A company wants to incorporate a third-party weh service to set the Address fields when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?

Question68: A company's support process dictates that any time a case is closed with a status of "Could net fix," an Engineering Review custom object record should be created and populated with information from the case, the contact, and any of the products associated with the case.
What Is the correct way to automate this using an Apex trigger?

Question69: A developer is tasked with creating a Lightning web component that allows users to create a Case for a selected product, directly from a custom Lightning page. The input fields in the component are displayed in a non-linear fashion on top of an image of the product to help the user better understand the meaning of the fields.
Which two components should a developer use to implement the creation of the Case from the Lightning web component?
Choose 2 answers

Question70: A developer wrote the following method to find all the test accounts in the org:

What should be used to fix this failing test?

Question71: A developer created the following test method:

The developer org has five accounts where the name starts with "Test". The developer executes this test in the Developer Console.
After the test code runs, which statement is true?

Question72: A developer is tasked with creating a Lightning web component that is responsive on various devices, Which two components should help accomplish this goal?
Choose 2 answers

Question73: Which interface needs to be implemented by an Aura component so that it may be displayed in modal dialog by clicking a button on a Lightning record page?

Question74: Consider the following code snippet:

The Apex method is executed in an environment with a large data volume count for Accounts, and the query is performing poorly.
Which technique should the developer implement to ensure the query performs optimally, while preserving the entire result set?

Question75: Universal Containers ne=ds to integrate with several external systems. The process Is Initiated when a record Is created in Salesforce, The remote systems do not require Salesforce to wait for a response before continuing.
What is the recommended best solution to accomplish this?

Question76: Just prior to a new deployment the Salesforce administrator, who configured a new order fulfillment process feature in a developer sandbox, suddenly left the company.
Ag part of the UAT cycle, the users had fully tested all of the changes in the sandbox and signed off on them; making the Order fulfillment feature ready for its go-live in the production environment.
Unfortunately, although a Change Set was started, it was not completed by the former administrator.
A developer is brought in to finish the deployment.
What should the developer do to identify the configuration changes that need to be moved into production?

Question77: Consider the following code snippet:

A developer created the following test class to provide the proper code coverage for the snippet above:

However, when the test runs, no data is returned and the assertion fails.
Which edit should the developer make to ensure the test class runs successfully?

Question78: What are three reasons that a developer should write Jest tests for Lightning web components?
Choose 3 answers

Question79: A company uses Dpportunities to track sales to their customers and their org has millions of Opportunities.
They want to begin to track revenue over time through a related Revenue object.
As part of their initial implementation, they want to perform a one-time seeding of their data by automatically creating and populating Revenue records for Opportunities, based on complex logic.
They estimate that roughly 100,000 Opportunities will have Revenue records created and populated.
What is the optimal way to automate this?

Question80: A company has a native iOS order placement app that needs to connect to Salesforce to retrieve consolidated information from many different objects in a JSON format.
Which is the optimal method to implement this in Salesforce?

Question81: Given the following containment hierarchy:
What is the correct way to communicate the new value of a property named ''passthrough'' to my-parent-component if the property is defined within my-child-component?

Question82: When developing a Lightning web component, which setting displays lightninglayout-items im one column on small devices, such as mobile phones, and in two columns on tablet-size and desktop-size screens?

Question83: Which technique can run custom logic when a Lightning web component is loaded?

Question84: Refer to the exhibit

Users of this Visualforce page complain that the page does a full refresh every time the Search button Is pressed.
What should the developer do to ensure that a partial refresh Is made so that only the section identified with opportunity List is re-drawn on the screen?

Question85: Universal Containers develops a Visualforce page that requires the inclusion of external JavaScript and C55 files. They want to ensure efficient loading and caching of the page.
Which feature should be utilized to achieve this goal?

Question86: A developer built an Aura component for guests to self-register upon arrival at a front desk kiosk. Now the developer needs to create a component for the utility tray to alert users whenever a guest arrives at the front desk.
What should be used?

Question87: For compliance purposes, a company is required to track long-term product usage in their org. The information that they need to log will be collected from more than one object and, over time, they predict they will have hundreds of millions of records.
What should a developer use to implement this?

Question88: After a platform event is defined in a Salesforce org,events can be published via which mechanism?

Question89: An Apex trigger creates an order co record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders.
What is the optimal technique for 2 developer to troubleshoot this?

Question90: A company has a web page that needs to get Account record information, such as name, website, and employee number. The Salesforce record 1D is known to the web page and it uses JavaScript to retrieve the account information.
Which method of integration is optimal?